(0) Obligation:

Clauses:

goal(X) :- ','(s2t(X, T), tree(T)).
tree(nil).
tree(X) :- ','(no(empty(X)), ','(left(T, L), ','(right(T, R), ','(tree(L), tree(R))))).
s2t(0, nil).
s2t(X, node(T, X1, T)) :- ','(no(zero(X)), ','(p(X, P), s2t(P, T))).
s2t(X, node(nil, X2, T)) :- ','(no(zero(X)), ','(p(X, P), s2t(P, T))).
s2t(X, node(T, X3, nil)) :- ','(no(zero(X)), ','(p(X, P), s2t(P, T))).
s2t(X, node(nil, X4, nil)) :- no(zero(X)).
left(nil, nil).
left(node(L, X5, X6), L).
right(nil, nil).
right(node(X7, X8, R), R).
p(0, 0).
p(s(X), X).
empty(nil).
zero(0).
no(X) :- ','(X, ','(!, failure(a))).
no(X9).
failure(b).

Query: goal(g)

(1) PrologToPrologProblemTransformerProof (SOUND transformation)

Built Prolog problem from termination graph ICLP10.

(2) Obligation:

Clauses:

s2tA(0, nil).
s2tA(s(T32), node(X88, X89, X88)) :- s2tA(T32, X88).
s2tA(s(T46), node(nil, X125, X126)) :- s2tA(T46, X126).
s2tA(s(T60), node(X162, X163, nil)) :- s2tA(T60, X162).
s2tA(T69, node(nil, X181, nil)).
treeB.
treeC(nil).
pD :- treeB.
pD :- ','(treeB, treeB).
pE(X248, X250) :- treeC(X248).
pE(T83, X250) :- ','(treeC(T83), treeC(X250)).
goalF(0) :- treeB.
goalF(s(T17)) :- s2tA(T17, X51).
goalF(s(T17)) :- ','(s2tA(T17, T82), pD).
goalF(s(T17)) :- ','(s2tA(T17, T82), pE(X248, X250)).
goalF(s(T97)) :- s2tA(T97, X296).
goalF(s(T97)) :- ','(s2tA(T97, T111), pD).
goalF(s(T97)) :- ','(s2tA(T97, T111), pE(X366, X368)).
goalF(s(T125)) :- s2tA(T125, X395).
goalF(s(T125)) :- ','(s2tA(T125, T139), pD).
goalF(s(T125)) :- ','(s2tA(T125, T139), pE(X466, X468)).
goalF(T148) :- pD.
goalF(T148) :- pE(X544, X546).

Query: goalF(g)

(3) PrologToPiTRSProof (SOUND transformation)

We use the technique of [TOCL09]. With regard to the inferred argument filtering the predicates were used in the following modes:
goalF_in: (b)
s2tA_in: (b,f)
pE_in: (f,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T17)) → U10_g(T17, s2tA_in_ga(T17, X51))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T32), node(X88, X89, X88)) → U1_ga(T32, X88, X89, s2tA_in_ga(T32, X88))
s2tA_in_ga(s(T46), node(nil, X125, X126)) → U2_ga(T46, X125, X126, s2tA_in_ga(T46, X126))
s2tA_in_ga(s(T60), node(X162, X163, nil)) → U3_ga(T60, X162, X163, s2tA_in_ga(T60, X162))
s2tA_in_ga(T69, node(nil, X181, nil)) → s2tA_out_ga(T69, node(nil, X181, nil))
U3_ga(T60, X162, X163, s2tA_out_ga(T60, X162)) → s2tA_out_ga(s(T60), node(X162, X163, nil))
U2_ga(T46, X125, X126, s2tA_out_ga(T46, X126)) → s2tA_out_ga(s(T46), node(nil, X125, X126))
U1_ga(T32, X88, X89, s2tA_out_ga(T32, X88)) → s2tA_out_ga(s(T32), node(X88, X89, X88))
U10_g(T17, s2tA_out_ga(T17, X51)) → goalF_out_g(s(T17))
goalF_in_g(s(T17)) → U11_g(T17, s2tA_in_ga(T17, T82))
U11_g(T17, s2tA_out_ga(T17, T82)) → U12_g(T17, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T17, pD_out_) → goalF_out_g(s(T17))
U11_g(T17, s2tA_out_ga(T17, T82)) → U13_g(T17, pE_in_aa(X248, X250))
pE_in_aa(X248, X250) → U6_aa(X248, X250, treeC_in_a(X248))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X248, X250, treeC_out_a(X248)) → pE_out_aa(X248, X250)
pE_in_aa(T83, X250) → U7_aa(T83, X250, treeC_in_a(T83))
U7_aa(T83, X250, treeC_out_a(T83)) → U8_aa(T83, X250, treeC_in_a(X250))
U8_aa(T83, X250, treeC_out_a(X250)) → pE_out_aa(T83, X250)
U13_g(T17, pE_out_aa(X248, X250)) → goalF_out_g(s(T17))
goalF_in_g(s(T97)) → U14_g(T97, s2tA_in_ga(T97, X296))
U14_g(T97, s2tA_out_ga(T97, X296)) → goalF_out_g(s(T97))
goalF_in_g(s(T97)) → U15_g(T97, s2tA_in_ga(T97, T111))
U15_g(T97, s2tA_out_ga(T97, T111)) → U16_g(T97, pD_in_)
U16_g(T97, pD_out_) → goalF_out_g(s(T97))
U15_g(T97, s2tA_out_ga(T97, T111)) → U17_g(T97, pE_in_aa(X366, X368))
U17_g(T97, pE_out_aa(X366, X368)) → goalF_out_g(s(T97))
goalF_in_g(s(T125)) → U18_g(T125, s2tA_in_ga(T125, X395))
U18_g(T125, s2tA_out_ga(T125, X395)) → goalF_out_g(s(T125))
goalF_in_g(s(T125)) → U19_g(T125, s2tA_in_ga(T125, T139))
U19_g(T125, s2tA_out_ga(T125, T139)) → U20_g(T125, pD_in_)
U20_g(T125, pD_out_) → goalF_out_g(s(T125))
U19_g(T125, s2tA_out_ga(T125, T139)) → U21_g(T125, pE_in_aa(X466, X468))
U21_g(T125, pE_out_aa(X466, X468)) → goalF_out_g(s(T125))
goalF_in_g(T148) → U22_g(T148, pD_in_)
U22_g(T148, pD_out_) → goalF_out_g(T148)
goalF_in_g(T148) → U23_g(T148, pE_in_aa(X544, X546))
U23_g(T148, pE_out_aa(X544, X546)) → goalF_out_g(T148)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog

(4) Obligation:

Pi-finite rewrite system:
The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T17)) → U10_g(T17, s2tA_in_ga(T17, X51))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T32), node(X88, X89, X88)) → U1_ga(T32, X88, X89, s2tA_in_ga(T32, X88))
s2tA_in_ga(s(T46), node(nil, X125, X126)) → U2_ga(T46, X125, X126, s2tA_in_ga(T46, X126))
s2tA_in_ga(s(T60), node(X162, X163, nil)) → U3_ga(T60, X162, X163, s2tA_in_ga(T60, X162))
s2tA_in_ga(T69, node(nil, X181, nil)) → s2tA_out_ga(T69, node(nil, X181, nil))
U3_ga(T60, X162, X163, s2tA_out_ga(T60, X162)) → s2tA_out_ga(s(T60), node(X162, X163, nil))
U2_ga(T46, X125, X126, s2tA_out_ga(T46, X126)) → s2tA_out_ga(s(T46), node(nil, X125, X126))
U1_ga(T32, X88, X89, s2tA_out_ga(T32, X88)) → s2tA_out_ga(s(T32), node(X88, X89, X88))
U10_g(T17, s2tA_out_ga(T17, X51)) → goalF_out_g(s(T17))
goalF_in_g(s(T17)) → U11_g(T17, s2tA_in_ga(T17, T82))
U11_g(T17, s2tA_out_ga(T17, T82)) → U12_g(T17, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T17, pD_out_) → goalF_out_g(s(T17))
U11_g(T17, s2tA_out_ga(T17, T82)) → U13_g(T17, pE_in_aa(X248, X250))
pE_in_aa(X248, X250) → U6_aa(X248, X250, treeC_in_a(X248))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X248, X250, treeC_out_a(X248)) → pE_out_aa(X248, X250)
pE_in_aa(T83, X250) → U7_aa(T83, X250, treeC_in_a(T83))
U7_aa(T83, X250, treeC_out_a(T83)) → U8_aa(T83, X250, treeC_in_a(X250))
U8_aa(T83, X250, treeC_out_a(X250)) → pE_out_aa(T83, X250)
U13_g(T17, pE_out_aa(X248, X250)) → goalF_out_g(s(T17))
goalF_in_g(s(T97)) → U14_g(T97, s2tA_in_ga(T97, X296))
U14_g(T97, s2tA_out_ga(T97, X296)) → goalF_out_g(s(T97))
goalF_in_g(s(T97)) → U15_g(T97, s2tA_in_ga(T97, T111))
U15_g(T97, s2tA_out_ga(T97, T111)) → U16_g(T97, pD_in_)
U16_g(T97, pD_out_) → goalF_out_g(s(T97))
U15_g(T97, s2tA_out_ga(T97, T111)) → U17_g(T97, pE_in_aa(X366, X368))
U17_g(T97, pE_out_aa(X366, X368)) → goalF_out_g(s(T97))
goalF_in_g(s(T125)) → U18_g(T125, s2tA_in_ga(T125, X395))
U18_g(T125, s2tA_out_ga(T125, X395)) → goalF_out_g(s(T125))
goalF_in_g(s(T125)) → U19_g(T125, s2tA_in_ga(T125, T139))
U19_g(T125, s2tA_out_ga(T125, T139)) → U20_g(T125, pD_in_)
U20_g(T125, pD_out_) → goalF_out_g(s(T125))
U19_g(T125, s2tA_out_ga(T125, T139)) → U21_g(T125, pE_in_aa(X466, X468))
U21_g(T125, pE_out_aa(X466, X468)) → goalF_out_g(s(T125))
goalF_in_g(T148) → U22_g(T148, pD_in_)
U22_g(T148, pD_out_) → goalF_out_g(T148)
goalF_in_g(T148) → U23_g(T148, pE_in_aa(X544, X546))
U23_g(T148, pE_out_aa(X544, X546)) → goalF_out_g(T148)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil

(5) DependencyPairsProof (EQUIVALENT transformation)

Using Dependency Pairs [AG00,LOPSTR] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

GOALF_IN_G(0) → U9_G(treeB_in_)
GOALF_IN_G(0) → TREEB_IN_
GOALF_IN_G(s(T17)) → U10_G(T17, s2tA_in_ga(T17, X51))
GOALF_IN_G(s(T17)) → S2TA_IN_GA(T17, X51)
S2TA_IN_GA(s(T32), node(X88, X89, X88)) → U1_GA(T32, X88, X89, s2tA_in_ga(T32, X88))
S2TA_IN_GA(s(T32), node(X88, X89, X88)) → S2TA_IN_GA(T32, X88)
S2TA_IN_GA(s(T46), node(nil, X125, X126)) → U2_GA(T46, X125, X126, s2tA_in_ga(T46, X126))
S2TA_IN_GA(s(T46), node(nil, X125, X126)) → S2TA_IN_GA(T46, X126)
S2TA_IN_GA(s(T60), node(X162, X163, nil)) → U3_GA(T60, X162, X163, s2tA_in_ga(T60, X162))
S2TA_IN_GA(s(T60), node(X162, X163, nil)) → S2TA_IN_GA(T60, X162)
GOALF_IN_G(s(T17)) → U11_G(T17, s2tA_in_ga(T17, T82))
U11_G(T17, s2tA_out_ga(T17, T82)) → U12_G(T17, pD_in_)
U11_G(T17, s2tA_out_ga(T17, T82)) → PD_IN_
PD_IN_U4_1(treeB_in_)
PD_IN_TREEB_IN_
U4_1(treeB_out_) → U5_1(treeB_in_)
U4_1(treeB_out_) → TREEB_IN_
U11_G(T17, s2tA_out_ga(T17, T82)) → U13_G(T17, pE_in_aa(X248, X250))
U11_G(T17, s2tA_out_ga(T17, T82)) → PE_IN_AA(X248, X250)
PE_IN_AA(X248, X250) → U6_AA(X248, X250, treeC_in_a(X248))
PE_IN_AA(X248, X250) → TREEC_IN_A(X248)
PE_IN_AA(T83, X250) → U7_AA(T83, X250, treeC_in_a(T83))
U7_AA(T83, X250, treeC_out_a(T83)) → U8_AA(T83, X250, treeC_in_a(X250))
U7_AA(T83, X250, treeC_out_a(T83)) → TREEC_IN_A(X250)
GOALF_IN_G(s(T97)) → U14_G(T97, s2tA_in_ga(T97, X296))
GOALF_IN_G(s(T97)) → U15_G(T97, s2tA_in_ga(T97, T111))
U15_G(T97, s2tA_out_ga(T97, T111)) → U16_G(T97, pD_in_)
U15_G(T97, s2tA_out_ga(T97, T111)) → PD_IN_
U15_G(T97, s2tA_out_ga(T97, T111)) → U17_G(T97, pE_in_aa(X366, X368))
U15_G(T97, s2tA_out_ga(T97, T111)) → PE_IN_AA(X366, X368)
GOALF_IN_G(s(T125)) → U18_G(T125, s2tA_in_ga(T125, X395))
GOALF_IN_G(s(T125)) → U19_G(T125, s2tA_in_ga(T125, T139))
U19_G(T125, s2tA_out_ga(T125, T139)) → U20_G(T125, pD_in_)
U19_G(T125, s2tA_out_ga(T125, T139)) → PD_IN_
U19_G(T125, s2tA_out_ga(T125, T139)) → U21_G(T125, pE_in_aa(X466, X468))
U19_G(T125, s2tA_out_ga(T125, T139)) → PE_IN_AA(X466, X468)
GOALF_IN_G(T148) → U22_G(T148, pD_in_)
GOALF_IN_G(T148) → PD_IN_
GOALF_IN_G(T148) → U23_G(T148, pE_in_aa(X544, X546))
GOALF_IN_G(T148) → PE_IN_AA(X544, X546)

The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T17)) → U10_g(T17, s2tA_in_ga(T17, X51))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T32), node(X88, X89, X88)) → U1_ga(T32, X88, X89, s2tA_in_ga(T32, X88))
s2tA_in_ga(s(T46), node(nil, X125, X126)) → U2_ga(T46, X125, X126, s2tA_in_ga(T46, X126))
s2tA_in_ga(s(T60), node(X162, X163, nil)) → U3_ga(T60, X162, X163, s2tA_in_ga(T60, X162))
s2tA_in_ga(T69, node(nil, X181, nil)) → s2tA_out_ga(T69, node(nil, X181, nil))
U3_ga(T60, X162, X163, s2tA_out_ga(T60, X162)) → s2tA_out_ga(s(T60), node(X162, X163, nil))
U2_ga(T46, X125, X126, s2tA_out_ga(T46, X126)) → s2tA_out_ga(s(T46), node(nil, X125, X126))
U1_ga(T32, X88, X89, s2tA_out_ga(T32, X88)) → s2tA_out_ga(s(T32), node(X88, X89, X88))
U10_g(T17, s2tA_out_ga(T17, X51)) → goalF_out_g(s(T17))
goalF_in_g(s(T17)) → U11_g(T17, s2tA_in_ga(T17, T82))
U11_g(T17, s2tA_out_ga(T17, T82)) → U12_g(T17, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T17, pD_out_) → goalF_out_g(s(T17))
U11_g(T17, s2tA_out_ga(T17, T82)) → U13_g(T17, pE_in_aa(X248, X250))
pE_in_aa(X248, X250) → U6_aa(X248, X250, treeC_in_a(X248))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X248, X250, treeC_out_a(X248)) → pE_out_aa(X248, X250)
pE_in_aa(T83, X250) → U7_aa(T83, X250, treeC_in_a(T83))
U7_aa(T83, X250, treeC_out_a(T83)) → U8_aa(T83, X250, treeC_in_a(X250))
U8_aa(T83, X250, treeC_out_a(X250)) → pE_out_aa(T83, X250)
U13_g(T17, pE_out_aa(X248, X250)) → goalF_out_g(s(T17))
goalF_in_g(s(T97)) → U14_g(T97, s2tA_in_ga(T97, X296))
U14_g(T97, s2tA_out_ga(T97, X296)) → goalF_out_g(s(T97))
goalF_in_g(s(T97)) → U15_g(T97, s2tA_in_ga(T97, T111))
U15_g(T97, s2tA_out_ga(T97, T111)) → U16_g(T97, pD_in_)
U16_g(T97, pD_out_) → goalF_out_g(s(T97))
U15_g(T97, s2tA_out_ga(T97, T111)) → U17_g(T97, pE_in_aa(X366, X368))
U17_g(T97, pE_out_aa(X366, X368)) → goalF_out_g(s(T97))
goalF_in_g(s(T125)) → U18_g(T125, s2tA_in_ga(T125, X395))
U18_g(T125, s2tA_out_ga(T125, X395)) → goalF_out_g(s(T125))
goalF_in_g(s(T125)) → U19_g(T125, s2tA_in_ga(T125, T139))
U19_g(T125, s2tA_out_ga(T125, T139)) → U20_g(T125, pD_in_)
U20_g(T125, pD_out_) → goalF_out_g(s(T125))
U19_g(T125, s2tA_out_ga(T125, T139)) → U21_g(T125, pE_in_aa(X466, X468))
U21_g(T125, pE_out_aa(X466, X468)) → goalF_out_g(s(T125))
goalF_in_g(T148) → U22_g(T148, pD_in_)
U22_g(T148, pD_out_) → goalF_out_g(T148)
goalF_in_g(T148) → U23_g(T148, pE_in_aa(X544, X546))
U23_g(T148, pE_out_aa(X544, X546)) → goalF_out_g(T148)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil
GOALF_IN_G(x1)  =  GOALF_IN_G(x1)
U9_G(x1)  =  U9_G(x1)
TREEB_IN_  =  TREEB_IN_
U10_G(x1, x2)  =  U10_G(x2)
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x4)
U11_G(x1, x2)  =  U11_G(x2)
U12_G(x1, x2)  =  U12_G(x2)
PD_IN_  =  PD_IN_
U4_1(x1)  =  U4_1(x1)
U5_1(x1)  =  U5_1(x1)
U13_G(x1, x2)  =  U13_G(x2)
PE_IN_AA(x1, x2)  =  PE_IN_AA
U6_AA(x1, x2, x3)  =  U6_AA(x3)
TREEC_IN_A(x1)  =  TREEC_IN_A
U7_AA(x1, x2, x3)  =  U7_AA(x3)
U8_AA(x1, x2, x3)  =  U8_AA(x1, x3)
U14_G(x1, x2)  =  U14_G(x2)
U15_G(x1, x2)  =  U15_G(x2)
U16_G(x1, x2)  =  U16_G(x2)
U17_G(x1, x2)  =  U17_G(x2)
U18_G(x1, x2)  =  U18_G(x2)
U19_G(x1, x2)  =  U19_G(x2)
U20_G(x1, x2)  =  U20_G(x2)
U21_G(x1, x2)  =  U21_G(x2)
U22_G(x1, x2)  =  U22_G(x2)
U23_G(x1, x2)  =  U23_G(x2)

We have to consider all (P,R,Pi)-chains

(6) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

GOALF_IN_G(0) → U9_G(treeB_in_)
GOALF_IN_G(0) → TREEB_IN_
GOALF_IN_G(s(T17)) → U10_G(T17, s2tA_in_ga(T17, X51))
GOALF_IN_G(s(T17)) → S2TA_IN_GA(T17, X51)
S2TA_IN_GA(s(T32), node(X88, X89, X88)) → U1_GA(T32, X88, X89, s2tA_in_ga(T32, X88))
S2TA_IN_GA(s(T32), node(X88, X89, X88)) → S2TA_IN_GA(T32, X88)
S2TA_IN_GA(s(T46), node(nil, X125, X126)) → U2_GA(T46, X125, X126, s2tA_in_ga(T46, X126))
S2TA_IN_GA(s(T46), node(nil, X125, X126)) → S2TA_IN_GA(T46, X126)
S2TA_IN_GA(s(T60), node(X162, X163, nil)) → U3_GA(T60, X162, X163, s2tA_in_ga(T60, X162))
S2TA_IN_GA(s(T60), node(X162, X163, nil)) → S2TA_IN_GA(T60, X162)
GOALF_IN_G(s(T17)) → U11_G(T17, s2tA_in_ga(T17, T82))
U11_G(T17, s2tA_out_ga(T17, T82)) → U12_G(T17, pD_in_)
U11_G(T17, s2tA_out_ga(T17, T82)) → PD_IN_
PD_IN_U4_1(treeB_in_)
PD_IN_TREEB_IN_
U4_1(treeB_out_) → U5_1(treeB_in_)
U4_1(treeB_out_) → TREEB_IN_
U11_G(T17, s2tA_out_ga(T17, T82)) → U13_G(T17, pE_in_aa(X248, X250))
U11_G(T17, s2tA_out_ga(T17, T82)) → PE_IN_AA(X248, X250)
PE_IN_AA(X248, X250) → U6_AA(X248, X250, treeC_in_a(X248))
PE_IN_AA(X248, X250) → TREEC_IN_A(X248)
PE_IN_AA(T83, X250) → U7_AA(T83, X250, treeC_in_a(T83))
U7_AA(T83, X250, treeC_out_a(T83)) → U8_AA(T83, X250, treeC_in_a(X250))
U7_AA(T83, X250, treeC_out_a(T83)) → TREEC_IN_A(X250)
GOALF_IN_G(s(T97)) → U14_G(T97, s2tA_in_ga(T97, X296))
GOALF_IN_G(s(T97)) → U15_G(T97, s2tA_in_ga(T97, T111))
U15_G(T97, s2tA_out_ga(T97, T111)) → U16_G(T97, pD_in_)
U15_G(T97, s2tA_out_ga(T97, T111)) → PD_IN_
U15_G(T97, s2tA_out_ga(T97, T111)) → U17_G(T97, pE_in_aa(X366, X368))
U15_G(T97, s2tA_out_ga(T97, T111)) → PE_IN_AA(X366, X368)
GOALF_IN_G(s(T125)) → U18_G(T125, s2tA_in_ga(T125, X395))
GOALF_IN_G(s(T125)) → U19_G(T125, s2tA_in_ga(T125, T139))
U19_G(T125, s2tA_out_ga(T125, T139)) → U20_G(T125, pD_in_)
U19_G(T125, s2tA_out_ga(T125, T139)) → PD_IN_
U19_G(T125, s2tA_out_ga(T125, T139)) → U21_G(T125, pE_in_aa(X466, X468))
U19_G(T125, s2tA_out_ga(T125, T139)) → PE_IN_AA(X466, X468)
GOALF_IN_G(T148) → U22_G(T148, pD_in_)
GOALF_IN_G(T148) → PD_IN_
GOALF_IN_G(T148) → U23_G(T148, pE_in_aa(X544, X546))
GOALF_IN_G(T148) → PE_IN_AA(X544, X546)

The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T17)) → U10_g(T17, s2tA_in_ga(T17, X51))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T32), node(X88, X89, X88)) → U1_ga(T32, X88, X89, s2tA_in_ga(T32, X88))
s2tA_in_ga(s(T46), node(nil, X125, X126)) → U2_ga(T46, X125, X126, s2tA_in_ga(T46, X126))
s2tA_in_ga(s(T60), node(X162, X163, nil)) → U3_ga(T60, X162, X163, s2tA_in_ga(T60, X162))
s2tA_in_ga(T69, node(nil, X181, nil)) → s2tA_out_ga(T69, node(nil, X181, nil))
U3_ga(T60, X162, X163, s2tA_out_ga(T60, X162)) → s2tA_out_ga(s(T60), node(X162, X163, nil))
U2_ga(T46, X125, X126, s2tA_out_ga(T46, X126)) → s2tA_out_ga(s(T46), node(nil, X125, X126))
U1_ga(T32, X88, X89, s2tA_out_ga(T32, X88)) → s2tA_out_ga(s(T32), node(X88, X89, X88))
U10_g(T17, s2tA_out_ga(T17, X51)) → goalF_out_g(s(T17))
goalF_in_g(s(T17)) → U11_g(T17, s2tA_in_ga(T17, T82))
U11_g(T17, s2tA_out_ga(T17, T82)) → U12_g(T17, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T17, pD_out_) → goalF_out_g(s(T17))
U11_g(T17, s2tA_out_ga(T17, T82)) → U13_g(T17, pE_in_aa(X248, X250))
pE_in_aa(X248, X250) → U6_aa(X248, X250, treeC_in_a(X248))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X248, X250, treeC_out_a(X248)) → pE_out_aa(X248, X250)
pE_in_aa(T83, X250) → U7_aa(T83, X250, treeC_in_a(T83))
U7_aa(T83, X250, treeC_out_a(T83)) → U8_aa(T83, X250, treeC_in_a(X250))
U8_aa(T83, X250, treeC_out_a(X250)) → pE_out_aa(T83, X250)
U13_g(T17, pE_out_aa(X248, X250)) → goalF_out_g(s(T17))
goalF_in_g(s(T97)) → U14_g(T97, s2tA_in_ga(T97, X296))
U14_g(T97, s2tA_out_ga(T97, X296)) → goalF_out_g(s(T97))
goalF_in_g(s(T97)) → U15_g(T97, s2tA_in_ga(T97, T111))
U15_g(T97, s2tA_out_ga(T97, T111)) → U16_g(T97, pD_in_)
U16_g(T97, pD_out_) → goalF_out_g(s(T97))
U15_g(T97, s2tA_out_ga(T97, T111)) → U17_g(T97, pE_in_aa(X366, X368))
U17_g(T97, pE_out_aa(X366, X368)) → goalF_out_g(s(T97))
goalF_in_g(s(T125)) → U18_g(T125, s2tA_in_ga(T125, X395))
U18_g(T125, s2tA_out_ga(T125, X395)) → goalF_out_g(s(T125))
goalF_in_g(s(T125)) → U19_g(T125, s2tA_in_ga(T125, T139))
U19_g(T125, s2tA_out_ga(T125, T139)) → U20_g(T125, pD_in_)
U20_g(T125, pD_out_) → goalF_out_g(s(T125))
U19_g(T125, s2tA_out_ga(T125, T139)) → U21_g(T125, pE_in_aa(X466, X468))
U21_g(T125, pE_out_aa(X466, X468)) → goalF_out_g(s(T125))
goalF_in_g(T148) → U22_g(T148, pD_in_)
U22_g(T148, pD_out_) → goalF_out_g(T148)
goalF_in_g(T148) → U23_g(T148, pE_in_aa(X544, X546))
U23_g(T148, pE_out_aa(X544, X546)) → goalF_out_g(T148)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil
GOALF_IN_G(x1)  =  GOALF_IN_G(x1)
U9_G(x1)  =  U9_G(x1)
TREEB_IN_  =  TREEB_IN_
U10_G(x1, x2)  =  U10_G(x2)
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)
U1_GA(x1, x2, x3, x4)  =  U1_GA(x4)
U2_GA(x1, x2, x3, x4)  =  U2_GA(x4)
U3_GA(x1, x2, x3, x4)  =  U3_GA(x4)
U11_G(x1, x2)  =  U11_G(x2)
U12_G(x1, x2)  =  U12_G(x2)
PD_IN_  =  PD_IN_
U4_1(x1)  =  U4_1(x1)
U5_1(x1)  =  U5_1(x1)
U13_G(x1, x2)  =  U13_G(x2)
PE_IN_AA(x1, x2)  =  PE_IN_AA
U6_AA(x1, x2, x3)  =  U6_AA(x3)
TREEC_IN_A(x1)  =  TREEC_IN_A
U7_AA(x1, x2, x3)  =  U7_AA(x3)
U8_AA(x1, x2, x3)  =  U8_AA(x1, x3)
U14_G(x1, x2)  =  U14_G(x2)
U15_G(x1, x2)  =  U15_G(x2)
U16_G(x1, x2)  =  U16_G(x2)
U17_G(x1, x2)  =  U17_G(x2)
U18_G(x1, x2)  =  U18_G(x2)
U19_G(x1, x2)  =  U19_G(x2)
U20_G(x1, x2)  =  U20_G(x2)
U21_G(x1, x2)  =  U21_G(x2)
U22_G(x1, x2)  =  U22_G(x2)
U23_G(x1, x2)  =  U23_G(x2)

We have to consider all (P,R,Pi)-chains

(7) DependencyGraphProof (EQUIVALENT transformation)

The approximation of the Dependency Graph [LOPSTR] contains 1 SCC with 37 less nodes.

(8) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

S2TA_IN_GA(s(T46), node(nil, X125, X126)) → S2TA_IN_GA(T46, X126)
S2TA_IN_GA(s(T32), node(X88, X89, X88)) → S2TA_IN_GA(T32, X88)
S2TA_IN_GA(s(T60), node(X162, X163, nil)) → S2TA_IN_GA(T60, X162)

The TRS R consists of the following rules:

goalF_in_g(0) → U9_g(treeB_in_)
treeB_in_treeB_out_
U9_g(treeB_out_) → goalF_out_g(0)
goalF_in_g(s(T17)) → U10_g(T17, s2tA_in_ga(T17, X51))
s2tA_in_ga(0, nil) → s2tA_out_ga(0, nil)
s2tA_in_ga(s(T32), node(X88, X89, X88)) → U1_ga(T32, X88, X89, s2tA_in_ga(T32, X88))
s2tA_in_ga(s(T46), node(nil, X125, X126)) → U2_ga(T46, X125, X126, s2tA_in_ga(T46, X126))
s2tA_in_ga(s(T60), node(X162, X163, nil)) → U3_ga(T60, X162, X163, s2tA_in_ga(T60, X162))
s2tA_in_ga(T69, node(nil, X181, nil)) → s2tA_out_ga(T69, node(nil, X181, nil))
U3_ga(T60, X162, X163, s2tA_out_ga(T60, X162)) → s2tA_out_ga(s(T60), node(X162, X163, nil))
U2_ga(T46, X125, X126, s2tA_out_ga(T46, X126)) → s2tA_out_ga(s(T46), node(nil, X125, X126))
U1_ga(T32, X88, X89, s2tA_out_ga(T32, X88)) → s2tA_out_ga(s(T32), node(X88, X89, X88))
U10_g(T17, s2tA_out_ga(T17, X51)) → goalF_out_g(s(T17))
goalF_in_g(s(T17)) → U11_g(T17, s2tA_in_ga(T17, T82))
U11_g(T17, s2tA_out_ga(T17, T82)) → U12_g(T17, pD_in_)
pD_in_U4_(treeB_in_)
U4_(treeB_out_) → pD_out_
U4_(treeB_out_) → U5_(treeB_in_)
U5_(treeB_out_) → pD_out_
U12_g(T17, pD_out_) → goalF_out_g(s(T17))
U11_g(T17, s2tA_out_ga(T17, T82)) → U13_g(T17, pE_in_aa(X248, X250))
pE_in_aa(X248, X250) → U6_aa(X248, X250, treeC_in_a(X248))
treeC_in_a(nil) → treeC_out_a(nil)
U6_aa(X248, X250, treeC_out_a(X248)) → pE_out_aa(X248, X250)
pE_in_aa(T83, X250) → U7_aa(T83, X250, treeC_in_a(T83))
U7_aa(T83, X250, treeC_out_a(T83)) → U8_aa(T83, X250, treeC_in_a(X250))
U8_aa(T83, X250, treeC_out_a(X250)) → pE_out_aa(T83, X250)
U13_g(T17, pE_out_aa(X248, X250)) → goalF_out_g(s(T17))
goalF_in_g(s(T97)) → U14_g(T97, s2tA_in_ga(T97, X296))
U14_g(T97, s2tA_out_ga(T97, X296)) → goalF_out_g(s(T97))
goalF_in_g(s(T97)) → U15_g(T97, s2tA_in_ga(T97, T111))
U15_g(T97, s2tA_out_ga(T97, T111)) → U16_g(T97, pD_in_)
U16_g(T97, pD_out_) → goalF_out_g(s(T97))
U15_g(T97, s2tA_out_ga(T97, T111)) → U17_g(T97, pE_in_aa(X366, X368))
U17_g(T97, pE_out_aa(X366, X368)) → goalF_out_g(s(T97))
goalF_in_g(s(T125)) → U18_g(T125, s2tA_in_ga(T125, X395))
U18_g(T125, s2tA_out_ga(T125, X395)) → goalF_out_g(s(T125))
goalF_in_g(s(T125)) → U19_g(T125, s2tA_in_ga(T125, T139))
U19_g(T125, s2tA_out_ga(T125, T139)) → U20_g(T125, pD_in_)
U20_g(T125, pD_out_) → goalF_out_g(s(T125))
U19_g(T125, s2tA_out_ga(T125, T139)) → U21_g(T125, pE_in_aa(X466, X468))
U21_g(T125, pE_out_aa(X466, X468)) → goalF_out_g(s(T125))
goalF_in_g(T148) → U22_g(T148, pD_in_)
U22_g(T148, pD_out_) → goalF_out_g(T148)
goalF_in_g(T148) → U23_g(T148, pE_in_aa(X544, X546))
U23_g(T148, pE_out_aa(X544, X546)) → goalF_out_g(T148)

The argument filtering Pi contains the following mapping:
goalF_in_g(x1)  =  goalF_in_g(x1)
0  =  0
U9_g(x1)  =  U9_g(x1)
treeB_in_  =  treeB_in_
treeB_out_  =  treeB_out_
goalF_out_g(x1)  =  goalF_out_g
s(x1)  =  s(x1)
U10_g(x1, x2)  =  U10_g(x2)
s2tA_in_ga(x1, x2)  =  s2tA_in_ga(x1)
s2tA_out_ga(x1, x2)  =  s2tA_out_ga(x2)
U1_ga(x1, x2, x3, x4)  =  U1_ga(x4)
U2_ga(x1, x2, x3, x4)  =  U2_ga(x4)
U3_ga(x1, x2, x3, x4)  =  U3_ga(x4)
node(x1, x2, x3)  =  node(x1, x3)
U11_g(x1, x2)  =  U11_g(x2)
U12_g(x1, x2)  =  U12_g(x2)
pD_in_  =  pD_in_
U4_(x1)  =  U4_(x1)
pD_out_  =  pD_out_
U5_(x1)  =  U5_(x1)
U13_g(x1, x2)  =  U13_g(x2)
pE_in_aa(x1, x2)  =  pE_in_aa
U6_aa(x1, x2, x3)  =  U6_aa(x3)
treeC_in_a(x1)  =  treeC_in_a
treeC_out_a(x1)  =  treeC_out_a(x1)
pE_out_aa(x1, x2)  =  pE_out_aa(x1)
U7_aa(x1, x2, x3)  =  U7_aa(x3)
U8_aa(x1, x2, x3)  =  U8_aa(x1, x3)
U14_g(x1, x2)  =  U14_g(x2)
U15_g(x1, x2)  =  U15_g(x2)
U16_g(x1, x2)  =  U16_g(x2)
U17_g(x1, x2)  =  U17_g(x2)
U18_g(x1, x2)  =  U18_g(x2)
U19_g(x1, x2)  =  U19_g(x2)
U20_g(x1, x2)  =  U20_g(x2)
U21_g(x1, x2)  =  U21_g(x2)
U22_g(x1, x2)  =  U22_g(x2)
U23_g(x1, x2)  =  U23_g(x2)
nil  =  nil
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(9) UsableRulesProof (EQUIVALENT transformation)

For (infinitary) constructor rewriting [LOPSTR] we can delete all non-usable rules from R.

(10) Obligation:

Pi DP problem:
The TRS P consists of the following rules:

S2TA_IN_GA(s(T46), node(nil, X125, X126)) → S2TA_IN_GA(T46, X126)
S2TA_IN_GA(s(T32), node(X88, X89, X88)) → S2TA_IN_GA(T32, X88)
S2TA_IN_GA(s(T60), node(X162, X163, nil)) → S2TA_IN_GA(T60, X162)

R is empty.
The argument filtering Pi contains the following mapping:
s(x1)  =  s(x1)
node(x1, x2, x3)  =  node(x1, x3)
nil  =  nil
S2TA_IN_GA(x1, x2)  =  S2TA_IN_GA(x1)

We have to consider all (P,R,Pi)-chains

(11) PiDPToQDPProof (SOUND transformation)

Transforming (infinitary) constructor rewriting Pi-DP problem [LOPSTR] into ordinary QDP problem [LPAR04] by application of Pi.

(12) Obligation:

Q DP problem:
The TRS P consists of the following rules:

S2TA_IN_GA(s(T46)) → S2TA_IN_GA(T46)

R is empty.
Q is empty.
We have to consider all (P,Q,R)-chains.

(13) QDPSizeChangeProof (EQUIVALENT transformation)

By using the subterm criterion [SUBTERM_CRITERION] together with the size-change analysis [AAECC05] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs:

  • S2TA_IN_GA(s(T46)) → S2TA_IN_GA(T46)
    The graph contains the following edges 1 > 1

(14) YES